var thrift = require('thrift');

//引入hello服务定义文件在同一路径下也要加 ./


var UserManager = require('./gen-nodejs/HelloWorldService.js'),

ttypes = require('./gen-nodejs/demoHello_types.js');

//创建连接和客户端

var connection = thrift.createConnection('localhost', 8088),

client = thrift.createClient(UserManager, connection);

//连接

connection.on('error', function(err) {

console.error(err);

});

//调用helloString函数

console.log(client.sayHello('111'));